/*
 * @Author: lixiang
 * @Date: 2020-09-21 10:38:30
 * @Description:
 */

import Vue from "vue";
import Vuex from "vuex";
import router from "vue-router";


Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    indexFormData: {},
    userInfo: localStorage.getItem("userInfo") ? JSON.parse(localStorage.getItem("userInfo")) : { id: '', phone: '' }
  },
  mutations: {
    // 保存首页formData数据
    saveUserInfo(state, data) {
      localStorage.setItem("userInfo", JSON.stringify(data));
      state.userInfo = JSON.parse(
        localStorage.getItem("userInfo") || ""
      );


    }
  },
  actions: {},
  modules: {}
});
